package com.spark.lola.statistics.entity;

import java.math.BigDecimal;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.spark.lola.support.common.util.TimeUtil;
import com.spark.lola.support.mybatis.entity.BaseModel;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * <p>
 * 供应商报表
 * </p>
 *
 * @author dengyejun
 * @since 2020-05-12
 */
@TableName("statistics_supplier")
@ApiModel(value="Supplier对象", description="供应商报表")
public class StatisticsSupplier extends BaseModel implements Serializable {
    private static final long serialVersionUID=1L;
    public StatisticsSupplier(){
    }
    public StatisticsSupplier(Long parentId,Date date){
        Integer month = TimeUtil.getMonth(date);
        Integer year = TimeUtil.getYear(date);
        this.parentId = parentId;
        this.createDate = date;
        this.createMonth = month;
        this.createYear = year;
    }
    @ApiModelProperty(value = "供应商id")
    private Long parentId;

    @ApiModelProperty(value = "供应商")
    @TableField(exist = false)
    @ExcelProperty("供应商")
    private String parentName;

    @ApiModelProperty(value = "供货次数")
    @ExcelProperty("供货次数")
    private Integer orderCount = 0;

    @ApiModelProperty(value = "退货次数")
    @ExcelProperty("退货次数")
    private Integer returnCount = 0;

    @ApiModelProperty(value = "付款总额")
    @ExcelProperty("付款总额")
    private BigDecimal orderPayment=BigDecimal.ZERO;;

    @ApiModelProperty(value = "供货总额")
    @ExcelProperty("供货总额")
    private BigDecimal orderSales = BigDecimal.ZERO;

    @ApiModelProperty(value = "采购总重")
    @ExcelProperty("采购总重")
    private BigDecimal orderWeight = BigDecimal.ZERO;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "创建日期 yyyy-MM-dd")
    @ExcelProperty("日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createDate;

    @ApiModelProperty(value = "创建月份 yyyyMM")
    @ExcelProperty("月份")
    private Integer createMonth;

    @ApiModelProperty(value = "创建年份yyyy")
    @ExcelProperty("年份")
    private Integer createYear;

    public Integer getReturnCount() {
        return returnCount;
    }

    public void setReturnCount(Integer returnCount) {
        this.returnCount = returnCount;
    }

    public Integer getOrderCount() {
        return orderCount;
    }

    public BigDecimal getOrderPayment() {
        return orderPayment;
    }

    public void setOrderPayment(BigDecimal orderPayment) {
        this.orderPayment = orderPayment;
    }

    public void setOrderCount(Integer orderCount) {
        this.orderCount = orderCount;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public BigDecimal getOrderSales() {
        return orderSales;
    }

    public void setOrderSales(BigDecimal orderSales) {
        this.orderSales = orderSales;
    }

    public BigDecimal getOrderWeight() {
        return orderWeight;
    }

    public void setOrderWeight(BigDecimal orderWeight) {
        this.orderWeight = orderWeight;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
        
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    
    public Integer getCreateMonth() {
        return createMonth;
    }

    public void setCreateMonth(Integer createMonth) {
        this.createMonth = createMonth;
    }
    
    public Integer getCreateYear() {
        return createYear;
    }

    public void setCreateYear(Integer createYear) {
        this.createYear = createYear;
    }

}
